//
//  HttpClient.h
//  AFNTest
//
//  Created by hebidu on 15/7/9.
//  Copyright (c) 2015年 Boye. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"



@interface BoyeHttpClient : NSObject


+ (void)startMonitorNetwork;
+ (void)stopMonitorNetwork;

// zk:post请求
/**
 *  post请求
 *
 *  @param type    请求类型（什么请求，登录？注册？。。。）
 *  @param params  明文参数（账号，密码等）内部进行加密
 *  @param success result：解密后的数据（一般为字典）
 *  @param failure 
 */
+ (void)post:(NSString *)type
   apiVerson:(NSInteger)ver
      params:(NSDictionary *)params
     success:(void(^)(AFHTTPRequestOperation *operation, id result))success
     failure:(void(^)(AFHTTPRequestOperation *operation, NSError *error))failure;



/**
 *  图片上传
 *
 *  @param image    图片
 *  @param type     类型(avatar=头像,gallery=相册,other=其它,ID=身份证)
 *  @param success  成功后，返回图片的网络地址
 *  @param failure  失败
 */
+ (void)uploadImage:(UIImage *)image
              type:(NSString *)type
           success:(void (^)(NSString *))success
           failure:(void(^)(AFHTTPRequestOperation *operation, NSError *error))failure ;

@end
